import Vue from "vue";
import VueRouter from "vue-router";
import Layout from "@/views/Layout.vue";
import Article from "@/views/Article.vue";
import Collect from "@/views/Collect.vue";
import Like from "@/views/Like.vue";
import User from "@/views/User.vue";
import Detail from "@/views/Detail.vue";
import DengLu from "@/views/DengLu.vue";
import ZhuChe from "@/views/ZhuChe.vue";
import NewM from "@/views/NewM.vue";
import RecomMend from "@/views/RecomMend.vue";

Vue.use(VueRouter);

const router = new VueRouter({
  routes: [
    //一级路由
    {
      path: "/",
      redirect: "/denglu",
    },
    {
      path: "/layout",
      component: Layout,
      children: [
        {
          path: "/layout/article",
          component: Article,
          children: [
            {
              path: "/layout/article/newm",
              component: NewM,
            },
            {
              path: "/layout/article/recommend",
              component: RecomMend,
            },
          ],
        },
        {
          path: "/layout/collect",
          component: Collect,
        },
        {
          path: "/layout/like",
          component: Like,
        },
        {
          path: "/layout/user",
          component: User,
        },
      ],
    },
    {
      path: "/detail",
      component: Detail,
    },
    {
      path: "/denglu",
      component: DengLu,
    },
    {
      path: "/zhuche",
      component: ZhuChe,
    },
  ],
  //改类名
  linkActiveClass: "active",
});

export default router;
